package Server.dao;

import Server.entity.Role;
import Server.entity.Shop;
import Server.entity.ShopClass;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface ShopDao extends JpaRepository<Shop,String> {
    Shop findByUuid(String uuid);
    @Query(value = "select `brand` as `name` from shop where shop_Class_Id=:#{#shopClass.uuid} and status<>'NO' group by `brand`",nativeQuery=true)
    List<Object[]> findByTypeGroupBy(ShopClass shopClass);
}
